package com.acsior.hibernate.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;

/**
 * PaymentService entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "obligation_services")
@GeneratorKey(tableName = "service_requests")
public class ObligationServiceVO extends PayableServiceVO {

	private static final long serialVersionUID = -3753850182074266765L;

	@Column(name = "client_number", nullable = false, length = 50)
	private String clientNumber;

	@Temporal(TemporalType.DATE)
	@Column(name = "contract_date", length = 10)
	private Date contractDate;

	@Column(name = "contract_number", length = 50)
	private String contractNumber;

	@Column(name = "contract_service_name", length = 100)
	private String contractServiceName;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id")
	private CustomerVO customer;

	@Temporal(TemporalType.DATE)
	@Column(name = "end_date", length = 10)
	private Date endDate;

	@Temporal(TemporalType.DATE)
	@Column(name = "invoice_date", length = 10)
	private Date invoiceDate;

	@Column(name = "invoice_number", length = 100)
	private String invoiceNumber;

	@Column(name = "obligation_number", length = 50, nullable = false)
	private String obligationNumber;

	@Column(name = "partially", nullable = false)
	private boolean partially;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "postman_payment_id")
	private PostmanPaymentVO postmanPayment;

	@Column(name = "remark")
	private String remark;

	@Temporal(TemporalType.DATE)
	@Column(name = "start_date", length = 10)
	private Date startDate;

	/** default constructor */
	public ObligationServiceVO() {
		super();
	}

	/** @return the clientNumber */
	public String getClientNumber() {
		return this.clientNumber;
	}

	/** @return the contractDate */
	public Date getContractDate() {
		return this.contractDate;
	}

	/** @return the contractNumber */
	public String getContractNumber() {
		return this.contractNumber;
	}

	/** @return the contractServiceName */
	public String getContractServiceName() {
		return this.contractServiceName;
	}

	/** @return the customer */
	@Override
	public CustomerVO getCustomer() {
		return this.customer;
	}

	/** @return the endDate */
	@Override
	public Date getEndDate() {
		return this.endDate;
	}

	/** @return the invoiceDate */
	public Date getInvoiceDate() {
		return this.invoiceDate;
	}

	/** @return the invoiceNumber */
	public String getInvoiceNumber() {
		return this.invoiceNumber;
	}

	/** @see PayableServiceVO#getNumber() */
	@Override
	public String getNumber() {
		return getObligationNumber();
	}

	/** @return the obligationNumber */
	public String getObligationNumber() {
		return this.obligationNumber;
	}

	/** @return the postmanPayment */
	@Override
	public PostmanPaymentVO getPostmanPayment() {
		return this.postmanPayment;
	}

	/** @return the remark */
	@Override
	public String getRemark() {
		return this.remark;
	}

	/** @return the startDate */
	@Override
	public Date getStartDate() {
		return this.startDate;
	}

	/** @return the partially */
	public boolean isPartially() {
		return this.partially;
	}

	/**
	 * @param clientNumber
	 *            the clientNumber to set
	 */
	public void setClientNumber(String clientNumber) {
		this.clientNumber = clientNumber;
	}

	/**
	 * @param contractDate
	 *            the contractDate to set
	 */
	public void setContractDate(Date contractDate) {
		this.contractDate = contractDate;
	}

	/**
	 * @param contractNumber
	 *            the contractNumber to set
	 */
	public void setContractNumber(String contractNumber) {
		this.contractNumber = contractNumber;
	}

	/**
	 * @param contractServiceName
	 *            the contractServiceName to set
	 */
	public void setContractServiceName(String contractServiceName) {
		this.contractServiceName = contractServiceName;
	}

	/**
	 * @param customer
	 *            the customer to set
	 */
	@Override
	public void setCustomer(CustomerVO customer) {
		this.customer = customer;
	}

	/**
	 * @param endDate
	 *            the endDate to set
	 */
	@Override
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	/**
	 * @param invoiceDate
	 *            the invoiceDate to set
	 */
	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	/**
	 * @param invoiceNumber
	 *            the invoiceNumber to set
	 */
	public void setInvoiceNumber(String invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}

	/** @see PayableServiceVO#setNumber(String) */
	@Override
	public void setNumber(String number) {
		setObligationNumber(number);
	}

	/**
	 * @param obligationNumber
	 *            the obligationNumber to set
	 */
	public void setObligationNumber(String obligationNumber) {
		this.obligationNumber = obligationNumber;
	}

	/** @param partially */
	public void setPartially(boolean partially) {
		this.partially = partially;
	}

	/** @param postmanPayment */
	@Override
	public void setPostmanPayment(PostmanPaymentVO postmanPayment) {
		this.postmanPayment = postmanPayment;
	}

	/**
	 * @param remark
	 *            the remark to set
	 */
	@Override
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @param startDate
	 *            the startDate to set
	 */
	@Override
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
}